#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
//连续和 O(N^3)算法
int main() {
    ll n = 15000;
    for (ll p = 1; p < n; p++)
        for (ll q = p + 1; q < n; q++) {
            //p+(p+1)+...+q=s
            ll s = 0;
            for (ll k = p; k <= q; k++) {
                s += k;
            }
            if (s == n) {
                cout << p << " " << q << endl;
            }
        }
    return 0;
}
